'''
营销首页
'''
from selenium.webdriver.common.by import By
from page.base_page import BasePage

class YingxiaoShouye(BasePage):
    url = 'http://192.168.1.25/crm/index.php?m=setting&a=sendsms'

    # 点击更多
    dianji_gd_locator = (By.CSS_SELECTOR,'body > div.navbar.navbar-inverse.navbar-fixed-top > div > div > div.nav-collapse.collapse > ul:nth-child(1) > li.dropdown > a')
    # 点击营销
    dianji_yx_locator = (By.CSS_SELECTOR,'body > div.navbar.navbar-inverse.navbar-fixed-top > div > div > div.nav-collapse.collapse > ul:nth-child(1) > li.dropdown.open > ul > li:nth-child(3) > a')
    # 点击发送短信
    dianjifsdx_locator = (By.CSS_SELECTOR, 'body > div.container > div.page-header > ul > li.active > a')
    # 点击发送邮件
    dianji_yj_locator = (By.CSS_SELECTOR, 'body > div.container > div.page-header > ul > li:nth-child(3) > a')
    # 点击设置
    dianjisz_locator = (By.CSS_SELECTOR, 'body > div.container > div.row > div:nth-child(2) > form > div > div:nth-child(2) > p > a')
    # 选择模板
    xzmb_locator = (By.XPATH, '//*[@id="fef "]')

    def dianjigengduo(self):
        self.driver.find_element(*self.dianji_gd_locator).click()

    def dianjiyingxiao(self):
        self.driver.find_element(*self.dianji_yx_locator).click()

    def dianjifasongduanxing(self):
        self.driver.find_element(*self.dianjifsdx_locator).click()

    def dianjishezhi(self):
        self.driver.find_element(*self.dianjisz_locator).click()

    def dianjifasongyoujian(self):
        self.driver.find_element(*self.dianji_yj_locator).click()

    def xuanzhemoban(self):
        self.driver.find_element(*self.xzmb_locator).click()

    # 获取页面url
    def get_url(self):
            url = self.driver.current_url
            return url

